/* Replication code for:

 "Can Raising the Stakes of Election Outcomes Increase Participation?
 Results from a Large-Scale Field Experiment in Local Elections"
 Gregory A. Huber, Alan S. Gerber, Daniel R. Biggers, & David J. Hendry
 British Journal of Political Science
 
 This is version 1.0
 10/9/2021
  
*******************************************************

 This Stata .do file performs all of the analyses
 reported in the main text and recreates all the 
 tables in the supporting information.
 
 Note: Table 1 is saved in the log file but not outputted separately

******************************************************/

clear
set more off

*set working directory and start log file.
cd ""
log using BJPS_Final_ReplicationLog.txt, replace text

use Final_Publication_Replication_Dataset.dta, replace

* Random assignment test
levelsof assignment_strata, local(levels)
foreach ctr of local levels {
  *di "-> Assignment Strata = `: label (assignment_strata) `ctr''"
  qui mlogit treatment agenov2013 Q_gender* Q_regyear Q_regyearmiss  if assignment_strata==`ctr' 
  di "-> For Assignment Strata = `: label (assignment_strata) `ctr'' p-value of LR test is `e(p)'"
 }

***************************
* Table 1 Analysis, Panels A and B
***************************

* Panel A
bysort assignment_strata: egen temp=total(T_anytreatment) 
table assignment_strata, c(N T_anytreatment mean temp mean T_anytreatment)
drop temp
* Panel B
preserve
qui keep if treatment~=0
bysort treatment: egen temp=total(T_anytreatment) 
count
replace temp=temp/r(N)
table treatment, c(N T_anytreatment mean temp)
restore

***********************
* Table 2 Regression Analysis
***********************

* Local storage for linear combination of coefficient tests
gen lincomtxt=""
gen lincommodel=""
gen lincomest=.
gen lincomp=.
local lincomctr=1

* Column #1
regress v_municipal_nov13 asd_* t_* [pweight= eachtreatweight], robust
summ v_municipal_nov13 if e(sample) & treatment==0
local meanofdv=r(mean)
count if treatment ~=0 & e(sample)
outreg2 using Tables/Table02, excel aster(se) dec(3) label bracket ///
  addstat("Total number treated", r(N), "Control Group Mean of DV", `meanofdv', "Stratum Fixed Effects", 1, "Town Fixed Effects", 0) ///
  title("Table 2. Effect of Mail Treatment about Election Stakes on Turnout") ///
  addnote("Note: Cell entries are OLS coefficient estimates using inverse probability weighting (see text for details) with robust standard errors in brackets. *p<.1, **p<.05, ***p<.001, two-tailed tests. Columns (4) - (6) use  Bonferroni corrected alpha thresholds: *p<.02, **p<.01, ***p<.002, two-tailed tests.") replace

	local lcmd="lincom t_budget_own - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 1" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_budget_state - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 1" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom (t_budget_state+t_budget_own)/2"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 1" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1
	
	local lcmd="lincom (t_budget_state+t_budget_own)/2 - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 1" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_tax_compare_own_to_lowstate - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 1" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_tax_compare_own_to_lowstate - t_tax_compare_own_to_highstate"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 1" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_tax_compare_own_to_highstate - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 1" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1
	
	* Text about pooling all 5 theoretically relevant treatments, both compared to no treatment and compared to placebo
	lincom (t_budget_own+t_budget_state+t_budget_comparison+t_tax_compare_own_to_lowstate+t_tax_compare_own_to_highstate)/5
	lincom ((t_budget_own+t_budget_state+t_budget_comparison+t_tax_compare_own_to_lowstate+t_tax_compare_own_to_highstate)/5) - t_placebo

* Column #2
regress v_municipal_nov13 asd_* townd_* t_* [pweight= eachtreatweight], robust

summ v_municipal_nov13 if e(sample) & treatment==0
local meanofdv=r(mean)
count if treatment ~=0 & e(sample)
outreg2 using Tables/Table02, excel aster(se) dec(3) label bracket ///
  addstat("Total number treated", r(N), "Control Group Mean of DV", `meanofdv', "Stratum Fixed Effects", 1, "Town Fixed Effects", 1) append

	local lcmd="lincom t_budget_own - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 2" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_budget_state - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 2" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom (t_budget_state+t_budget_own)/2"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 2" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1
	
	local lcmd="lincom (t_budget_state+t_budget_own)/2 - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 2" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_tax_compare_own_to_lowstate - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 2" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_tax_compare_own_to_lowstate - t_tax_compare_own_to_highstate"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 2" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_tax_compare_own_to_highstate - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 2" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1
	
	* Text about pooling all 5 theoretically relevant treatments, both compared to no treatment and compared to placebo
	lincom (t_budget_own+t_budget_state+t_budget_comparison+t_tax_compare_own_to_lowstate+t_tax_compare_own_to_highstate)/5
	lincom ((t_budget_own+t_budget_state+t_budget_comparison+t_tax_compare_own_to_lowstate+t_tax_compare_own_to_highstate)/5) - t_placebo

* Column #3
regress v_municipal_nov13 asd_* townd_* Q_* t_* [pweight= eachtreatweight], robust

summ v_municipal_nov13 if e(sample) & treatment==0
local meanofdv=r(mean)
count if treatment ~=0 & e(sample)
outreg2 using Tables/Table02, excel aster(se) dec(3) label bracket ///
  addstat("Total number treated", r(N), "Control Group Mean of DV", `meanofdv', "Stratum Fixed Effects", 1, "Town Fixed Effects", 1) append

	local lcmd="lincom t_budget_own - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 3" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_budget_state - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 3" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom (t_budget_state+t_budget_own)/2"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 3" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1
	
	local lcmd="lincom (t_budget_state+t_budget_own)/2 - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 3" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_tax_compare_own_to_lowstate - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 3" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_tax_compare_own_to_lowstate - t_tax_compare_own_to_highstate"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 3" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_tax_compare_own_to_highstate - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 3" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1
	
	* Text about pooling all 5 theoretically relevant treatments, both compared to no treatment and compared to placebo
	lincom (t_budget_own+t_budget_state+t_budget_comparison+t_tax_compare_own_to_lowstate+t_tax_compare_own_to_highstate)/5
	lincom ((t_budget_own+t_budget_state+t_budget_comparison+t_tax_compare_own_to_lowstate+t_tax_compare_own_to_highstate)/5) - t_placebo

*columns 4-6 with adjusted alphas for 5 tests.
***NOTE: Using stars for corrected alphas is done here, but it does this for all
***significance tests including for covariates.

* Column #4
regress v_municipal_nov13 asd_* t_* [pweight= eachtreatweight], robust
summ v_municipal_nov13 if e(sample) & treatment==0
local meanofdv=r(mean)
count if treatment ~=0 & e(sample)
outreg2 using Tables/Table02, excel alpha(0.002, 0.01, 0.02) aster(se) dec(3) label bracket ///
  addstat("Total number treated", r(N), "Control Group Mean of DV", `meanofdv', "Stratum Fixed Effects", 1, "Town Fixed Effects", 0) append

	local lcmd="lincom t_budget_own - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 4" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_budget_state - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 4" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom (t_budget_state+t_budget_own)/2"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 4" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1
	
	local lcmd="lincom (t_budget_state+t_budget_own)/2 - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 4" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_tax_compare_own_to_lowstate - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 4" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_tax_compare_own_to_lowstate - t_tax_compare_own_to_highstate"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 4" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_tax_compare_own_to_highstate - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 4" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1
	
	* Text about pooling all 5 theoretically relevant treatments, both compared to no treatment and compared to placebo
	lincom (t_budget_own+t_budget_state+t_budget_comparison+t_tax_compare_own_to_lowstate+t_tax_compare_own_to_highstate)/5
	lincom ((t_budget_own+t_budget_state+t_budget_comparison+t_tax_compare_own_to_lowstate+t_tax_compare_own_to_highstate)/5) - t_placebo

* Column #5
regress v_municipal_nov13 asd_* townd_* t_* [pweight= eachtreatweight], robust

summ v_municipal_nov13 if e(sample) & treatment==0
local meanofdv=r(mean)
count if treatment ~=0 & e(sample)
outreg2 using Tables/Table02, excel alpha(0.002, 0.01, 0.02) aster(se) dec(3) label bracket ///
  addstat("Total number treated", r(N), "Control Group Mean of DV", `meanofdv', "Stratum Fixed Effects", 1, "Town Fixed Effects", 1) append

	local lcmd="lincom t_budget_own - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 5" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_budget_state - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 5" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom (t_budget_state+t_budget_own)/2"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 5" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1
	
	local lcmd="lincom (t_budget_state+t_budget_own)/2 - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 5" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_tax_compare_own_to_lowstate - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 5" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_tax_compare_own_to_lowstate - t_tax_compare_own_to_highstate"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 5" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_tax_compare_own_to_highstate - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 5" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1
	
	* Text about pooling all 5 theoretically relevant treatments, both compared to no treatment and compared to placebo
	lincom (t_budget_own+t_budget_state+t_budget_comparison+t_tax_compare_own_to_lowstate+t_tax_compare_own_to_highstate)/5
	lincom ((t_budget_own+t_budget_state+t_budget_comparison+t_tax_compare_own_to_lowstate+t_tax_compare_own_to_highstate)/5) - t_placebo

* Column #6
regress v_municipal_nov13 asd_* townd_* Q_* t_* [pweight= eachtreatweight], robust

summ v_municipal_nov13 if e(sample) & treatment==0
local meanofdv=r(mean)
count if treatment ~=0 & e(sample)
outreg2 using Tables/Table02, excel alpha(0.002, 0.01, 0.02) aster(se) dec(3) label bracket ///
  addstat("Total number treated", r(N), "Control Group Mean of DV", `meanofdv', "Stratum Fixed Effects", 1, "Town Fixed Effects", 1) append

	local lcmd="lincom t_budget_own - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 6" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_budget_state - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 6" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom (t_budget_state+t_budget_own)/2"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 6" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1
	
	local lcmd="lincom (t_budget_state+t_budget_own)/2 - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 6" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_tax_compare_own_to_lowstate - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 6" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_tax_compare_own_to_lowstate - t_tax_compare_own_to_highstate"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 6" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1

	local lcmd="lincom t_tax_compare_own_to_highstate - t_placebo"
	`lcmd'
	replace lincomtxt = "`lcmd'" in `lincomctr'
	replace lincommodel="column 6" in `lincomctr'
	replace lincomest=`r(estimate)' in `lincomctr'
	replace lincomp=2*ttail(`r(df)',abs(`r(estimate)'/`r(se)')) in `lincomctr'
	local lincomctr=`lincomctr'+1
	
	* Text about pooling all 5 theoretically relevant treatments, both compared to no treatment and compared to placebo
	lincom (t_budget_own+t_budget_state+t_budget_comparison+t_tax_compare_own_to_lowstate+t_tax_compare_own_to_highstate)/5
	lincom ((t_budget_own+t_budget_state+t_budget_comparison+t_tax_compare_own_to_lowstate+t_tax_compare_own_to_highstate)/5) - t_placebo

* Outsheet lincoms
preserve
keep if lincomtxt~=""
keep lincom*
outsheet using tables\Table02_lincoms.csv, comma replace
restore

***********************
* Table S1: Table 2 Analysis without strata fixed effects
***********************

*#1
regress v_municipal_nov13 t_* [pweight= eachtreatweight], robust

summ v_municipal_nov13 if e(sample) & treatment==0
local meanofdv=r(mean)
count if treatment ~=0 & e(sample)
outreg2 using Tables/TableS1, excel aster(se) dec(3) label bracket ///
  addstat("Total number treated", r(N), "Control Group Mean of DV", `meanofdv', "Stratum Fixed Effects", 0, "Town Fixed Effects", 0) ///
  title("Table S1. Effect of Mail Treatment about Election Stakes on Turnout, Models Estimated without Strata Fixed Effects") ///
  addnote("Note: Cell entries are OLS coefficient estimates using inverse probability weighting (see text for details) with robust standard errors in brackets. *p<.1, **p<.05, ***p<.01, two-tailed tests.") replace

*#2
regress v_municipal_nov13 townd_* t_* [pweight= eachtreatweight], robust

summ v_municipal_nov13 if e(sample) & treatment==0
local meanofdv=r(mean)
count if treatment ~=0 & e(sample)
outreg2 using Tables/TableS1, excel aster(se) dec(3) label bracket ///
  addstat("Total number treated", r(N), "Control Group Mean of DV", `meanofdv', "Stratum Fixed Effects", 0, "Town Fixed Effects", 1) append

*#3
regress v_municipal_nov13  townd_* Q_* t_* [pweight= eachtreatweight], robust

summ v_municipal_nov13 if e(sample) & treatment==0
local meanofdv=r(mean)
count if treatment ~=0 & e(sample)
outreg2 using Tables/TableS1, excel aster(se) dec(3) label bracket ///
  addstat("Total number treated", r(N), "Control Group Mean of DV", `meanofdv', "Stratum Fixed Effects", 0, "Town Fixed Effects", 1) append

***********************
* Table S2: Table 2 Analysis excluding those missing from post-treatment voter file as missing (rather than not having voted)
***********************

*#1
regress v_municipal_nov13 asd_* t_* if v_missingin2014vf==0 [pweight= eachtreatweight], robust

summ v_municipal_nov13 if e(sample) & treatment==0
local meanofdv=r(mean)
count if treatment ~=0 & e(sample)
outreg2 using Tables/TableS2, excel aster(se) dec(3) label bracket ///
  addstat("Total number treated", r(N), "Control Group Mean of DV", `meanofdv', "Stratum Fixed Effects", 1, "Town Fixed Effects", 0) ///
  title("Table S2. Effect of Mail Treatment about Election Stakes on Turnout, Excluding those Missing in Post-Election Voter File") ///
  addnote("Note: Cell entries are OLS coefficient estimates using inverse probability weighting (see text for details) with robust standard errors in brackets. *p<.1, **p<.05, ***p<.01, two-tailed tests.") replace

*#2
regress v_municipal_nov13 asd_* townd_* t_* if v_missingin2014vf==0 [pweight= eachtreatweight], robust

summ v_municipal_nov13 if e(sample) & treatment==0
local meanofdv=r(mean)
count if treatment ~=0 & e(sample)
outreg2 using Tables/TableS2, excel aster(se) dec(3) label bracket ///
  addstat("Total number treated", r(N), "Control Group Mean of DV", `meanofdv', "Stratum Fixed Effects", 1, "Town Fixed Effects", 1) append

*#3
regress v_municipal_nov13 asd_* townd_* Q_* t_* if v_missingin2014vf==0 [pweight= eachtreatweight], robust

summ v_municipal_nov13 if e(sample) & treatment==0
local meanofdv=r(mean)
count if treatment ~=0 & e(sample)
outreg2 using Tables/TableS2, excel aster(se) dec(3) label bracket ///
  addstat("Total number treated", r(N), "Control Group Mean of DV", `meanofdv', "Stratum Fixed Effects", 1, "Town Fixed Effects", 1) append

***********************
* Table S3: Analysis by town-level spending levels
***********************

* Note: Analysis restricted to control, placebo, and budget-treatments
regress v_municipal_nov13 asd_* townd_* Z_t_* [pweight= eachtreatweight] if treatment==0 | treatment==1 | treatment==2 | treatment==3 | treatment ==4, robust
summ v_municipal_nov13 if e(sample) & treatment==0
local meanofdv=r(mean)
count if treatment ~=0 & e(sample)
outreg2 using Tables/TableS3, excel aster(se) dec(3) label bracket ///
  addstat("Total number treated", r(N), "Control Group Mean of DV", `meanofdv', "Stratum Fixed Effects", 1, "Town Fixed Effects", 1) ///
  title("Table S3. Effect of Mail Treatment about Local Budget on Turnout by Town-Level Spending Levels") ///
  addnote("OLS regression estimates with robust Huber/White standard errors in brackets. Dependent variable is whether the individual voted in the 2013 November municipal election (1=yes, 0=no). Strata fixed effects not reported to save space. Data weighted to account for different rates of treatment assignment across treatment and strata.") replace

log close
